/*
 *此javaCode由YMS-JDBC替换工具生成，原mapper位置com.yonyou.ucf.mdf.app.isvdxq.firstpart.guize.mapper.ServiceListMapper
 */
package com.yonyou.ucf.mdf.app.isvdxq.firstpart.guize.mapper;

import com.yonyou.iuap.yms.api.IYmsJdbcApi;
import com.yonyou.iuap.yms.param.*;
import com.yonyou.iuap.yms.param.ResultSetProcessor;
import com.yonyou.iuap.yms.processor.*;
import com.yonyou.ucf.mdf.app.isvdxq.firstpart.guize.entity.ServiceList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class ServiceListMapperImpl {

    @Autowired
    private IYmsJdbcApi ymsJdbcApi;

    public ServiceList Selectservicelist(String tenantId) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "select * from dxq_servicelist where ytenant_id=? limit 0,1\n";
        parameter.addParam(tenantId);

        ResultSetProcessor processor = new AutoBeanProcessor(new ServiceList());
        return (ServiceList) ymsJdbcApi.queryForObject(sql, parameter, processor);
    }


    public int Insertservicelist(String tenantId, String applicationId, String serviceId, String serviceName, String serviceCode, String enable, String url, String serviceIcon, String capable, String ykjId, String clientStatus, String webStatus, String phoneStatus, String strategy, String hasWidget) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "INSERT INTO `dxq_servicelist`(`ytenant_id`,`applicationId`,`serviceId`,`serviceName`,`serviceCode`,`enable`,`url`,`serviceIcon`,`capable`,`ykjId`,`clientStatus`,`webStatus`,`phoneStatus`,`strategy`,`hasWidget`)\n" +
			         "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)                                                                                                                                                                           \n";
        parameter.addParam(tenantId);
		parameter.addParam(applicationId);
		parameter.addParam(serviceId);
		parameter.addParam(serviceName);
		parameter.addParam(serviceCode);
		parameter.addParam(enable);
		parameter.addParam(url);
		parameter.addParam(serviceIcon);
		parameter.addParam(capable);
		parameter.addParam(ykjId);
		parameter.addParam(clientStatus);
		parameter.addParam(webStatus);
		parameter.addParam(phoneStatus);
		parameter.addParam(strategy);
		parameter.addParam(hasWidget);

        
        return ymsJdbcApi.update(sql, parameter);
    }


    public int deleteservicelist() {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "delete * from dxq_servicelist\n";
        
        
        return ymsJdbcApi.update(sql, parameter);
    }

}
